<div class="linkStyle1">
	<a href="<?php echo site_url();?>/category">Create New Category</a>
</div>
<?php echo form_open('category/search', array('method' => 'get')); ?>
<div class="searchPanel">
	<input type="text" name="search" class="textboxSearch"
		value="<?php echo $search; ?>"
		placeholder="please enter the keyword" maxlength="30" /> <input
		type="submit" class="buttonSearch" value="search">
</div>
<?php echo form_close(); ?>
<div class="titleStyle1">Search Results</div>
<?php if (sizeof($result)> 0) {

	echo '<div class="serachResultTable ">';
	echo '<table id="resultTable">';
	echo '<tr>';
	echo '<td style="display:none;"></td>';
	echo '<td>';
	echo 'Category';
	echo '</td>';
	echo '</tr>';

	foreach ($result as $category){
		echo '<tr>';
		echo '<td style="display:none;">';
		echo $category->category_id;
		echo '</td>';
		echo '<td>';
		echo $category->category_name;
		echo '</td>';
		echo '</tr>';
	}

	echo '</table>';
	echo '</div>';
	echo $links;
}else{
	echo '<div class="information">';
	echo 'no result found.';
	echo '</div>';
}
?>

<script>
	$('#resultTable').find('tr').click( function(){
	  var item_id = $(this).find('td:first').text();
	  if (item_id > 0 )
	  	window.location.replace('<?php echo site_url()?>' + '/category/update/' + item_id);
	});
</script>
